import { Link, Routes, Route } from "react-router-dom";
import "./App.scss";
import Cart from "./pages/cart";
import Drug from "./pages/drug";
import Drugdeltias from "./pages/drugdeltias";
import Home from "./pages/home";
import Detaildoctor from "./pages/homes/detaildoctor";
import Doctor from "./pages/homes/doctor";
import Login from "./pages/login";
import Privaterouter from "./pages/private/privaterouter";
import Res from "./pages/res";
import User from "./pages/user";

function App() {
  return (
    <div className="App">
      <div className="content">
        <Routes>
          <Route path="/" element={<Home />}></Route>
          <Route path="/drug" element={<Drug />}></Route>
          <Route path="/cart" element={<Cart />}></Route>
          {/* 私有路由 */}

          <Route
            path="/user/*"
            element={
              <Privaterouter>
                <User />
              </Privaterouter>
            }
          ></Route>
          <Route path="/doctor" element={<Doctor></Doctor>}></Route>
          <Route
            path="/detaildoctor"
            element={<Detaildoctor></Detaildoctor>}
          ></Route>
          {/* 登录注册 */}
          <Route path="/login" element={<Login />}></Route>
          <Route path="/res" element={<Res />}></Route>
          <Route path="/delitas" element={<Drugdeltias />}></Route>
        </Routes>
      </div>

      <div className="Navbar">
        <Link to="/">【首页】</Link>
        <Link to="/drug">【找药】</Link>
        <Link to="/cart">【购物车】</Link>
        <Link to="/user">【我的】</Link>
      </div>
    </div>
  );
}

export default App;
